from os import sep
import  requests
import parsel
import csv

url='https://www.futunn.com/stock/ZH-US?seo_redirect=1&channel=1244&subchannel=2&from=BaiduAladdin&utm_source=alading_user&utm_medium=website_growth'
headers={'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36'}
request_html=requests.get(url=url,headers=headers)
html_data=request_html.text
pars=parsel.Selector(html_data).css('.news-box li')
print(pars)
for itme in pars:
    item1=itme.css('p::text').getall()
    dx=item1
    print(dx)
    
    with open('股市信息.csv',mode='a',encoding='utf-8',newline='') as f:
        csv_write=csv.writer(f)
        csv_write.writerow([item1])